<?php 

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @category    ChinaWanderer
 * @package     Backend
 * @subpackage  Template
 * @author      Chen Qiao <chen.qiao@evebit.com>
 * @version     $$Id: index.phtml 114 2011-03-17 03:31:17Z chen.qiao $$
 * @copyright   Copyright (c) 2011 Evebit Inc. China (http://www.evebit.com)
 */

$paginator = $this->paginator;
$tableTitle=$this->__("User");
$tableImage="16_48x48.png";
$viewAction="index";
$this->headTitle($this->__($tableTitle.' Management'));
$this->module = 'user/';
?>

<?php $this->placeholder('grid-content')->captureStart('SET') ?>
	<?php foreach($this->paginator as $item):?>
        <tr title="<?php echo $item->getName()?>" >			    	    			
        	<td class="a-center ">
                 <input type="checkbox" class="massaction-checkbox" value="<?php echo $item->getId()?>" name="id[]">
            </td>
            <td class="a-right "><?php echo $item->getId()?></td>
            
            <td><?php echo $item->getUsername()?></td>		
            <td><?php echo $item->getEmail()?></td>
            <td><?php echo $item->getSelectRole()?></td>
            <td >
	            <div class="meta">
	            <ul style="margin-left:-9px;">
							<li><a href="<?php echo $this->baseUrl('/user/'.$viewAction.'/edit/id/'.$item->getId())?>" style="width:60px;" class="tooltip" title="Edit the data" href="#"><span class="ui-icon ui-icon-document"></span>
							<?php echo $this->__("Edit") ?></a></li>
						</ul>	
						</div>
            </td> 
        </tr>
	<?php endforeach; ?>
<?php $this->placeholder('grid-content')->captureEnd() ?>

    
<?php echo $this->action(
		'render', 'block', 'blocks',
		array(
			'template'=>'grid',
			'grid'=>'users',
		    'tableTitle'=>$tableTitle,
		    'tableImage'=>$tableImage,
		    'viewAction'=>$viewAction,
			'state'=>$this->state,
			'paginator'=>$this->paginator,
			'buttons'=>array(
					array(
						'type'=>'button',
						'class'=>'scalable',
						'title'=>$this->__('Reset Filter'), 
						'action'=>"setLocation('{$this->baseUrl("user/index/reset")}')"
					),
					array(
						'type'=>'submit',
					    'class'=>'scalable task',
					    'title'=>$this->__('Search'), 				    						
					)
				),
			'massactions'=>array(									
					array(
						'default'=>false,
						'title'=>$this->__("Delete"),
						'value'=>'delete'											
					)
				),
			'colnums'=>array(		
				'checkbox' => '&nbsp;',
				'id' => $this->__('ID'),
				'username' => $this->__('Full Name'),				
				'email' => $this->__('Email'),
				'role' => $this->__('Role'),	
				'action' => $this->__('Action'),			
				),
			'action'=> $this->baseUrl('user/index'),
			'content'=> $this->placeholder('grid-content'),
		)
	) ?>  